package com.yunqiao.service.api.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunqiao.common.utils.PageUtils;
import com.yunqiao.common.utils.Query;

import com.yunqiao.service.api.mapper.UsualAddressMapper;
import com.yunqiao.service.api.entity.UsualAddressEntity;
import com.yunqiao.service.api.UsualAddressService;


@Service("usualAddressService")
public class UsualAddressServiceImpl extends ServiceImpl<UsualAddressMapper, UsualAddressEntity> implements UsualAddressService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        //各种查询条件的过滤,在此进行
        QueryWrapper<UsualAddressEntity> queryWrapper = new QueryWrapper<>();
        //类型
        if (params.get("userId") != null) {
            queryWrapper.eq("user_id", params.get("userId"));
        }
        IPage<UsualAddressEntity> page = this.page(new Query<UsualAddressEntity>(params).getPage(),queryWrapper);
        return new PageUtils(page);
    }

}
